﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AjaxCustomerRelation.aspx.cs"
    Inherits="_Default" %>

<fieldset>
    <asp:repeater id="rptData" runat="server">
            <ItemTemplate>
                <tr onmouseover="this.style.background='#dbf0c9'" onmouseout="this.style.background='#ffffff'" cusid='<%#Eval("ID") %>'>
                 <td align="center">
                        <%# DataBinder.Eval(Container.DataItem, "Select")%>
                    </td>
                    <td align="center" style="display:none;">
                        <%# DataBinder.Eval(Container.DataItem, "LastUpdate")%>
                    </td>
                    <%if (Session["crSwitchExpImp"].ToString()=="0"){ %>
                     <td  editable="<%=isEditInline %>" code="HsGoods" title=' <%# DataBinder.Eval(Container.DataItem, "HsGoods") %>'>
                        <%# DataBinder.Eval(Container.DataItem, "HsGoods") %>
                    </td>
                    <td editable="<%=isEditInline %>" code="Goods" title=' <%# DataBinder.Eval(Container.DataItem, "Goods") %>'>
                        <%# DataBinder.Eval(Container.DataItem, "Goods") %>
                    </td>
                    <%}else{ %>
                     <td editable="<%=isEditInline %>" code="HsGoodsEx" title=' <%# DataBinder.Eval(Container.DataItem, "HsGoodsEx") %>'>
                        <%# DataBinder.Eval(Container.DataItem, "HsGoodsEx")%>
                    </td>
                    <td editable="<%=isEditInline %>" code="GoodsEx" title=' <%# DataBinder.Eval(Container.DataItem, "GoodsEx") %>'>
                        <%# DataBinder.Eval(Container.DataItem, "GoodsEx")%>
                    </td>
                    <%} %>
                    <td style="color:Blue;font-size:12px;" editable="<%=isEditInline %>" code="Code"  title=' <%# DataBinder.Eval(Container.DataItem, "Code") %>'>
                        <%# DataBinder.Eval(Container.DataItem, "Code") %>
                    </td>
                    <td style="color:Blue;font-size:12px;" editable="<%=isEditInline %>" code="Name" class='<%#Eval("Duplicate").ToString()=="1"?" red":" " %>' title=' <%# DataBinder.Eval(Container.DataItem, "Name") %>'>
                        <%# DataBinder.Eval(Container.DataItem, "Name") %>
                    </td>
                    <td editable="<%=isEditInline %>" code="Address" completesource="por" title=' <%# DataBinder.Eval(Container.DataItem, "Address") %>'>
                        <%# DataBinder.Eval(Container.DataItem, "Address")%>
                    </td>                     
                    <td editable="true" code="Pic"  onclick='OpenCustomer(this,"<%# GetCustomerLink(DataBinder.Eval(Container.DataItem, "ID"),DataBinder.Eval(Container.DataItem, "PicID")) %>")'  class='<%#GetCellClass(Eval("ID"))%>'  title=' <%# DataBinder.Eval(Container.DataItem, "Pic") %>'>
                       <%# DataBinder.Eval(Container.DataItem, "Pic")%>
                    </td>
                    <td editable="true" code="Position" class=""  title=' <%# DataBinder.Eval(Container.DataItem, "Position") %>' style="display: none;">
                        <%# DataBinder.Eval(Container.DataItem, "Position")%>
                    </td>
                    <td editable="true" code="Tel"  class=""  title=' <%# DataBinder.Eval(Container.DataItem, "Tel") %>'>
                        <%# DataBinder.Eval(Container.DataItem, "Tel")%>
                    </td>
                    <td editable="true" code="Mobile"  class=""  title=' <%# DataBinder.Eval(Container.DataItem, "Mobile") %>' style="display: none;">
                        <%# DataBinder.Eval(Container.DataItem, "Mobile")%>
                    </td>
                    <td editable="true" code="Email"  class="ellipsis" title=' <%# DataBinder.Eval(Container.DataItem, "Email") %>' style="display: none;">
                        <%# DataBinder.Eval(Container.DataItem, "Email")%>
                    </td>
                    <td editable="true" code="Social"  class="" title=' <%# DataBinder.Eval(Container.DataItem, "Social") %>' style="display: none;">
                        <%# DataBinder.Eval(Container.DataItem, "Social")%>
                    </td>                    
                    <td editable="true" code="Pol"  class=""  title=' <%# DataBinder.Eval(Container.DataItem, "Pol") %>'>
                        <%# DataBinder.Eval(Container.DataItem, "Pol")%>
                    </td>
                    <td editable="true" code="Routers"  class=""  title=' <%# DataBinder.Eval(Container.DataItem, "Routers") %>'>
                        <%# DataBinder.Eval(Container.DataItem, "Routers")%>
                    </td>
                    <td editable="true" code="Vols"  class=""  title=' <%# DataBinder.Eval(Container.DataItem, "Vols") %>'>
                        <%# DataBinder.Eval(Container.DataItem, "Vols")%>
                    </td>
                    <td editable="true" code="Report"  class=""  title=' <%# DataBinder.Eval(Container.DataItem, "Report") %>'>
                        <%# DataBinder.Eval(Container.DataItem, "Report")%>
                    </td>
                    <%if ((Session["customerrelation"] != null) && (int.Parse(Session["customerrelation"].ToString()) >= 3))
                      {%>
                    <td align="center"><div class="changed">
                        <%# DataBinder.Eval(Container.DataItem, "Action") %></div>
                    </td>
                    <%} %>
                    
                </tr>
            </ItemTemplate>
            <HeaderTemplate>
                <table cellspacing="0" cellpadding="0" border="0" class="adminlist" editcellcontent="true" >
                    <thead>
                        <tr>
                         <th align="center" class="thheader" width="2%" rowspan="2">
                               <input type="checkbox" id="checkall<%=strtId%>" name="checkall<%=strtId%>" onclick="checkAll();" /></th>
                            <th align="center" class="thheader" width="50px" rowspan="2" style="display:none;">
                                Update</th>
                                 <%if (Session["crSwitchExpImp"].ToString() == "0")
                                   { %>
                            <th align="center" class="thheader resizeable" colspan="2">
                                Hàng XK</th>
                                <%}else{ %>
                            <th align="center" class="thheader resizeable"  colspan="2">
                            Hàng NK</th>
                            <%} %>
                              <th align="center" class="thheader resizeable" rowspan="2">
                                MKH</th>
                            <th align="center" class="thheader resizeable" rowspan="2">
                                Tên C.ty khách hàng</th>
                            <th align="center" class="thheader resizeable" width="10%" rowspan="2">
                                Address</th>
                          
                            <th align="center" class="thheader resizeable " rowspan="2">
                                Pic</th>
                            <th align="center" class="thheader resizeable" rowspan="2" style="display: none;">
                                Position</th>
                            <th align="center" class="thheader resizeable"  rowspan="2">
                                Tel</th>
                            <th align="center" class="thheader resizeable"  rowspan="2" style="display: none;">
                                Mobile</th>                                 
                            <th align="center" class="thheader resizeable"  rowspan="2" style="display: none;">
                                Email</th>
                            <th align="center" class="thheader resizeable"  rowspan="2" style="display: none;">
                                Social</th>
                           <th align="center" class="thheader resizeable" rowspan="2">
                                POL</th>
                            <th align="center" class="thheader resizeable" rowspan="2">
                                POD</th>
                            <th align="center" class="thheader resizeable" rowspan="2">
                                Vol / month
                            </th>
                            <th align="center" class="thheader resizeable" rowspan="2">
                                Report</th>
                            <%if ((Session["customerrelation"] != null) && (int.Parse(Session["customerrelation"].ToString()) >= 3))
                              {%>
                            <th class="thheader" rowspan="2">
                                Action</th>
                            <%} %>
                           
                        </tr>
                        <tr>
                         <%if (Session["crSwitchExpImp"].ToString() == "0"){%>
                            <th class="thheader resizeable" width="50px">CODE
                            </th>
                            <th class="thheader resizeable"  width="100px">
                            XK
                            </th>
                            <%}else{ %>
                           <th class="thheader resizeable" width="50px">
                            CODE
                            </th>
                            <th class="thheader resizeable"  width="100px">
                            NK
                            </th>
                            <%} %>
                        </tr>
                    </thead>
            </HeaderTemplate>
            <FooterTemplate>
                </TABLE>
            </FooterTemplate>
        </asp:repeater>
</fieldset>
<div class="clear">
</div>
<div id="Div3" style="margin-top: 5px;">
    <div style="width: 80%; float: left;">
        <%=strPager%>
    </div>
    <div style="float: right; margin: 8px 8px 0 0; font-weight: bold; font-size: 14px;
        color: Red;">
        Total:
        <%=nTotalItem%>
    </div>
    <div style="clear: both">
    </div>
</div>
<input type="hidden" id="txtListCustomerIDAjaxLoad<%=strtId%>" value="<%=strListCustIDAjaxLoad %>" />
<script language="javascript" type="text/javascript">
    function OpenEditForm(sender, id, picid) {
        if ($.trim($(sender).text()) != "") {
            window.open('/customer.aspx?id=' + id + '&picid=' + picid, 'mywindowTimkiem', 'left=250,top=50,menubar=0,resizable=0,location=1,toolbar=0,status=1,scrollbars=1,width=100%,height=100%');
        }
    }
</script>
